<?php 

        // dialog terima
        $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
            'id'=>'terimaDialog',
            // additional javascript options for the dialog plugin
            'options'=>array(
                'title'=>'Pilih Ruang dan Waktu',
                'autoOpen'=>false,
                'modal' => true,
                'width' => '500'
            ),
        ));

        
        $this->beginWidget('ext.widgets.XPanel', array('title' => 'Penerimaan Tamu', 'width' => 900,'height' => 500));
        
        $form   =   $this->beginWidget('ext.CAxActiveForm', array(
                            'id'=>'penerimaan-tamu-form',
                            'enableAjaxValidation'=>false,
                            'action' => Yii::app()->createUrl(
                                    'PenerimaanTamu/accept',
                                    array(
                                        'id_penerimaan_tamu' => $PenerimaanTamu->id_penerimaan_tamu
                                    )
                                )
                    )); 
        ?>
        <table>
            <tr>
                <td><?php echo $form->labelEx($Meetingroom,'Ruang');?></td>
                <td>
                    <?php 
                    echo $form->dropDownList(
                            $Meetingroom, 
                            'id_meetingroom', 
                            CHtml::listData(
                                    $Meetingroom->findAll(), 
                                    'id_meetingroom', 
                                    'nama'
                            ), 
                            array(
                                'empty'=>'--- Pilih Ruang --'
                                )
                            ) ?>
                </td>
            </tr>
            <tr>
                <td><?php echo $form->labelEx($Meetingroom,'Waktu Mulai Pemakaian');?></td>
                <td>
                    
                    <?php 
                                    $this->widget(
                                                'ext.jui.EJuiDateTimePicker',
                                                array(
                                                    'model'     => new PemakaianMeetingroom,
                                                    'attribute' => 'mulai',
                                                    'value' => 's',
                                                    'language'=> 'en',//default Yii::app()->language
                                                    'mode'    => 'time',//'datetime' or 'time' ('datetime' default)
                                                    'options'   => array(
                                                        'defaultValue' => date("H:i"),
                                                        'dateFormat' => 'dd-mm-yy',
                                                        'timeFormat' => 'hh:mm tt',//'hh:mm tt' default
                                                    ),
                                                    'htmlOptions'=>array(
                                                        'placeholder'=>'Mulai'
                                                    )
                                                )
                                            );
                                        
                    ?>
                </td>
            </tr>
            <tr>
                <td><?php echo $form->labelEx($Meetingroom,'Waktu akhir');?></td>
                <td>
                    <?php 
                                    $this->widget(
                                                'ext.jui.EJuiDateTimePicker',
                                                array(
                                                    'model'     => new PemakaianMeetingroom,
                                                    'attribute' => 'akhir',
                                                    'language'=> 'en',//default Yii::app()->language
                                                    'mode'    => 'time',//'datetime' or 'time' ('datetime' default)
                                                    'options'   => array(
                                                        'dateFormat' => 'dd-mm-yy',
                                                        'timeFormat' => 'hh:mm tt',//'hh:mm tt' default
                                                    ),
                                                    'htmlOptions'=>array(
                                                        'placeholder'=>'jadwal Mulai'
                                                    )
                                                )
                                            );
                                        
                    ?>
                </td>
            </tr>
        </table>
        <?php
        
        echo CHtml::submitButton('Simpan', array('class'=>'ax-btn'));
        
        $this->endWidget(); //CAxActiveForm
        
        $this->endWidget(); //XPanel
        
        $this->endWidget('zii.widgets.jui.CJuiDialog'); //CJuiDialog

        // the link that may open the dialog
        echo CHtml::button('Terima', array(
            'class' => 'ax-btn',
        'onclick'=>'$("#terimaDialog").dialog("open"); return false;',
        ));
        // dialog terima
?>